package com.xinqi.modules.stats.utils;

import java.math.BigDecimal;

public class MathUtils {

    public static BigDecimal stripTrailingZeros(BigDecimal bg,Integer scale){
        if (bg == null) {
            bg = new BigDecimal(0);
        }
        return new BigDecimal(bg.setScale(scale, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());
    }

}
